package com.xianyun.site.support.common.define;

/**
 * 先做成枚举 后续会修改成数据库形式
 * @author mac_zyj
 */
public enum SupportTypeEnum {
    /**短信*/
    SMS_MESSAGE(0,"短信"),
    /**邮件*/
    SMTP_MESSAGE(1,"邮件");

    private Integer typeId;

    private String typeName;

    SupportTypeEnum(int typeId, String typeName) {
        this.typeId = typeId;
        this.typeName = typeName;
    }

    public static String getTypeNameByTypeId(int typeId){
        for (SupportTypeEnum supportTypeEnum : values()){
            if (typeId == supportTypeEnum.typeId){
                return supportTypeEnum.typeName;
            }
        }
        return null;
    }

    public static SupportTypeEnum getTypeEnum(String typeName){
        for (SupportTypeEnum supportTypeEnum : values()){
            if (typeName.equals(supportTypeEnum.typeName)){
                return supportTypeEnum;
            }
        }
        return null;
    }
}
